import datetime
from dataclasses import dataclass
from typing import Self


@dataclass
class UserEntity:
    id: int | None = None
    name: str | None = None
    telegram_id: int | None = None
    phone: str | None = None
    email: str | None = None
    onboarding: bool = False
    created_at: datetime.datetime | None = None

    @classmethod
    def create(cls, phone: str) -> Self:
        user = cls(phone=phone)
        return user
